<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simpla Admin</title>
<jsp:include page="css.jsp"></jsp:include>
<jsp:include page="script.jsp"></jsp:include>
<script type="text/javascript">
	$(document).ready(function() {
		$("#login_btn").click(function() {
			var username = $("#username").val();
			var errDiv = $("#err_div");
			var errDivContent = $("#err_div_content");
			if (username == null || username.length < 1) {
				errDivContent.html("아이디!");
				errDiv.show();
				return false;
			}

			var password = $("#password").val();
			if (password == null || password.length < 1) {
				errDivContent.html("비밀번호!");
				errDiv.show();
				return false;
			}
			errDivContent.html("");
			errDiv.hide();
			return true;
		});
	});
</script>
</head>
<body id="login">
	<div id="login-wrapper" class="png_bg">
		<div id="login-top">
			<h1>Simpla Admin</h1>
			<!-- Logo (221px width) -->
			<img id="logo" src="<%=request.getContextPath()%>/images/logo.png" alt="Simpla Admin" />
			<a href="<%=request.getContextPath()%>/data.apk">apk 다운로드</a>
		</div>
		<!-- End #logn-top -->
		<div id="login-content">
			<form action="<%=request.getContextPath()%>/login.htm" method="post" id="login_form">
				<s:if test="hasFieldErrors()">
					<div class="notification information png_bg" id="err_div">
						<div id="err_div_content"><s:fielderror/></div>
					</div>
				</s:if> 
				<s:else>
					<div class="notification information png_bg" style="display: none" id="err_div">
						<div id="err_div_content"></div>
					</div>
				</s:else>
				<p>
					<label>아이디</label> <input class="text-input" type="text" name="username" id="username" />
				</p>
				<div class="clear"></div>
				<p>
					<label>비밀번호</label> <input class="text-input" type="password" name="password" id="password" />
				</p>
				<div class="clear" style="display: none;"></div>
				<p id="remember-password" style="display: none;">
					<input type="checkbox" /> Remember me
				</p>
				<div class="clear"></div>
				<p>
					<input class="button" type="submit" value="로그인" id="login_btn" />
				</p>
			</form>
		</div>
		<!-- End #login-content -->
	</div>
	<img id="logo" src="<%=request.getContextPath()%>/images/liantu.png" alt="Simpla Admin" style="max-height: 100px;max-width: 100px;position:absolute;right:0px;top: 0px;margin-top: 20px;margin-right: 20px;"/>
	<!-- End #login-wrapper -->
</body>
</html>
